#include "page_adapter_down.h"

MyPageAdapterDown::MyPageAdapterDown()
{
    dataList.emplace_back(1, nullptr);
    dataList.emplace_back(2, nullptr);
};
int MyPageAdapterDown::getCount()
{
    return dataList.size();
};
bool MyPageAdapterDown::isViewFromObject(View *view, void *object)
{
    return view == object;
};
void *MyPageAdapterDown::instantiateItem(ViewGroup *container, int position)
{
    ViewGroup *lunBoLayoutDown = nullptr;

    if (position == 0)
    {
        lunBoLayoutDown = (ViewGroup *)LayoutInflater::from(container->getContext())->inflate("@layout/page_lunbo_down", nullptr);
    }
    if (position == 1)
    {
        lunBoLayoutDown = (ViewGroup *)LayoutInflater::from(container->getContext())->inflate("@layout/page_lunbo_down2", nullptr);
    }

    dataList[position].adapterLayout = lunBoLayoutDown;
    container->addView(lunBoLayoutDown);
    return lunBoLayoutDown;
};
void MyPageAdapterDown::destroyItem(ViewGroup *container, int position, void *object)
{
    container->removeView((View *)object);
    delete (View *)object;
};
std::string MyPageAdapterDown::getPageTitle(int position)
{
    return "";
};
float MyPageAdapterDown::getPageWidth(int position)
{
    return 1.f;
};